<!doctype html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="代码编辑器," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.0" />






<meta name="description" content="除了常用的插件安装功能外，sublime还有一些提供便捷的小技巧 快捷键 Command + D 选中一个单词 Command + L 选中一行 Ctrl + Command + M选中括号内所有内容 (编写CSS或JS时非常实用) 按住 Command 键再点击想选中的行 Command + Ctrl + G (选中部分文本时) 按此键选中所有相同文本  css排序CSS属性的顺序一般不重要，因">
<meta name="keywords" content="代码编辑器">
<meta property="og:type" content="article">
<meta property="og:title" content="sublime编辑器的使用（二）小技巧">
<meta property="og:url" content="http://lanbos.win/2015/01/11/tools/sublime_base02/index.html">
<meta property="og:site_name" content="lanbos&#39;blog">
<meta property="og:description" content="除了常用的插件安装功能外，sublime还有一些提供便捷的小技巧 快捷键 Command + D 选中一个单词 Command + L 选中一行 Ctrl + Command + M选中括号内所有内容 (编写CSS或JS时非常实用) 按住 Command 键再点击想选中的行 Command + Ctrl + G (选中部分文本时) 按此键选中所有相同文本  css排序CSS属性的顺序一般不重要，因">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2016-12-30T10:03:38.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="sublime编辑器的使用（二）小技巧">
<meta name="twitter:description" content="除了常用的插件安装功能外，sublime还有一些提供便捷的小技巧 快捷键 Command + D 选中一个单词 Command + L 选中一行 Ctrl + Command + M选中括号内所有内容 (编写CSS或JS时非常实用) 按住 Command 键再点击想选中的行 Command + Ctrl + G (选中部分文本时) 按此键选中所有相同文本  css排序CSS属性的顺序一般不重要，因">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    sidebar: {"position":"left","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://lanbos.win/2015/01/11/tools/sublime_base02/"/>





  <title> sublime编辑器的使用（二）小技巧 | lanbos'blog </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  










  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">lanbos'blog</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">这个人假装很懒，什么都没有留下</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="http://lanbos.win/2015/01/11/tools/sublime_base02/">

  <span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="lanbos">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="https://ws1.sinaimg.cn/large/5c9d16d6gw1fbesf3zrhej209p09ftai.jpg">
  </span>

  <span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="lanbos'blog">
    <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
      <img style="display:none;" itemprop="url image" alt="lanbos'blog" src="">
    </span>
  </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                sublime编辑器的使用（二）小技巧
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2015-01-11T08:55:29+08:00">
                2015-01-11
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
              <span class="post-meta-divider">|</span>
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/常用工具/" itemprop="url" rel="index">
                    <span itemprop="name">常用工具</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          

          
          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>除了常用的插件安装功能外，sublime还有一些提供便捷的小技巧</p>
<h2 id="快捷键"><a href="#快捷键" class="headerlink" title="快捷键"></a>快捷键</h2><ul>
<li><code>Command + D</code> 选中一个单词</li>
<li><code>Command + L</code> 选中一行</li>
<li><code>Ctrl + Command + M</code>选中括号内所有内容 (编写CSS或JS时非常实用)</li>
<li>按住 Command 键再点击想选中的行</li>
<li><code>Command + Ctrl + G</code> (选中部分文本时) 按此键选中所有相同文本</li>
</ul>
<h2 id="css排序"><a href="#css排序" class="headerlink" title="css排序"></a>css排序</h2><p>CSS属性的顺序一般不重要，因为无论何种顺序浏览器都能正确渲染。但排序所有的属性还是有助于代码的整洁。在Sublime Text中，选中CSS属性后按 F5 就可以按字母顺序排序。<br><a id="more"></a></p>
<h2 id="跨文件编辑"><a href="#跨文件编辑" class="headerlink" title="跨文件编辑"></a>跨文件编辑</h2><p>同一个编辑操作可以在多个文件中同时重复。举个例子，多个文件中有同一段代码时，可用以下的步骤快速编辑：</p>
<ol>
<li>按 <code>Command + Shift + F</code> 在 Find 框中输入待查找的代码。可按 <code>Command + E</code> 快速使用选择中的代码段。</li>
<li>在 Where 框中指定需要查找的文件范围，或填写 <code>&lt;open files&gt;</code>表示查找目前打开的文件。</li>
<li>在 Replace 框中输入要替换成的代码，按 Replace 按钮批量替换。</li>
</ol>
<h2 id="文件爬虫"><a href="#文件爬虫" class="headerlink" title="文件爬虫"></a>文件爬虫</h2><p>按 <code>Command + R</code> 可以列出文档中所有的CSS选择器。可以选择并立刻跳转查看。这个操作比使用一般的“查找”功能快得多。</p>
<h2 id="更换Sublime-Text程序图标"><a href="#更换Sublime-Text程序图标" class="headerlink" title="更换Sublime Text程序图标"></a>更换Sublime Text程序图标</h2><p>在 <a href="https://dribbble.com/search?q=sublime+icon" target="_blank" rel="external">Dribbble</a> 上有大量重新设计的Sublime Text精美图标。更换方法：<br>1.下载一个图标，有 .icns 格式的最好。如果没有，用 <a href="https://iconverticons.com/online/" target="_blank" rel="external">iConvert</a> 转换之。<br>2.终端执行： <code>open /Applications/Sublime\ Text.app/Contents/Resources/</code><br>3.替换 <code>Sublime Text 3.icns</code> 或 <code>Sublime Text 2.icns</code> 文件。</p>
<h2 id="在终端中使用sublime打开文件"><a href="#在终端中使用sublime打开文件" class="headerlink" title="在终端中使用sublime打开文件"></a>在终端中使用sublime打开文件</h2><p>有时候我们想在终端中用外部程序打开某个文件或者执行某个文件，以sublime text为例，希望命令行工具用sublime 打开某个文件。<br>sublime 提供命令行的工具叫subs，路径在：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl</div></pre></td></tr></table></figure></p>
<p>使用ln命令<br>ln命令是做文件链接用的，不恰当的例子可以称之为建立快捷方式。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">ln  /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl</div></pre></td></tr></table></figure></p>
<p>如上命令是将sublime提供的subl命令链接到usr/local/bin/subl 这个路径上来，usr/local/bin 这个文件夹是全局都可以访问到的命令所在的目录，都是我们自己下载安装的一些命令行工具链接所在地 比如npm、httpie等.</p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>


    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/代码编辑器/" rel="tag"># 代码编辑器</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2015/01/10/tools/sublime_base01/" rel="next" title="sublime编辑器的使用（一）插件安装">
                <i class="fa fa-chevron-left"></i> sublime编辑器的使用（一）插件安装
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2015/02/10/hexo/hexo_decorateBlog/" rel="prev" title="hexo装饰(一)">
                hexo装饰(一) <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
  </div>
  <!-- UY BEGIN -->
<div id="uyan_frame"></div>
<script type="text/javascript" src="http://v2.uyan.cc/code/uyan.js?uid=2123221"></script>
<!-- UY END -->



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="https://ws1.sinaimg.cn/large/5c9d16d6gw1fbesf3zrhej209p09ftai.jpg"
               alt="lanbos" />
          <p class="site-author-name" itemprop="name">lanbos</p>
          <p class="site-description motion-element" itemprop="description">这个人假装很懒，什么都没有留下</p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">24</span>
              <span class="site-state-item-name">日志</span>
            </a>
          </div>

          
            <div class="site-state-item site-state-categories">
              
                <span class="site-state-item-count">5</span>
                <span class="site-state-item-name">分类</span>
              
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">16</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
        </div>

        
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#快捷键"><span class="nav-number">1.</span> <span class="nav-text">快捷键</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#css排序"><span class="nav-number">2.</span> <span class="nav-text">css排序</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#跨文件编辑"><span class="nav-number">3.</span> <span class="nav-text">跨文件编辑</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#文件爬虫"><span class="nav-number">4.</span> <span class="nav-text">文件爬虫</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#更换Sublime-Text程序图标"><span class="nav-number">5.</span> <span class="nav-text">更换Sublime Text程序图标</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#在终端中使用sublime打开文件"><span class="nav-number">6.</span> <span class="nav-text">在终端中使用sublime打开文件</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">lanbos</span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Mist
  </a>
</div>


        

        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.0"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.0"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.0"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.0"></script>



  



  




	




  
  

  

  

  

  


</body>
</html>
